Skip to content

Conversation

vorburger
Copy link
Contributor

ToDo:

  • Test coverage

@odisseus
Copy link
Contributor

odisseus commented Apr 24, 2024

The premise of this PR is completely wrong.

First, Qm isn't the right prefix for Base58. In fact, no valid Multibase string can start with Q. See specification, implementation.

The hashes that start with Qm are typical (though not required) for IPFS, and they actually don't include the Multibase prefix. See discussion.

Second, the method Base58.encode from io.ipfs.multibase produces results which already include the base prefix. See test examples.

@vorburger
Copy link
Contributor Author

@odisseus sorry for a (very) delayed response, but better late than never?

Yeah, I meanwhile that I better understand what's what agree that this as-is doesn't make any sense.

Somewhat related: The underlying problem that I really was after was to "have an object that encapsulates both a Multihash and the Multibase that it was originally expressed in (e.g. to provide it as context in error messages)". In my project, I have now written a MultihashWithMultibase for this purpose. Do you think adding that here could make sense? If yes, I'm happy to raise a PR. If no, I'll close this issue.

@ianopolous @mk868 any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants